﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysMenu")]
    public class SysMenu : BaseEntity
    {
        public enum EnumMenuStatus
        { 启用 = 0, 禁用 = 1, 必须显示 = 10 }

        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid MenuId { get; set; }

        [Required]
        [Column(TypeName = "varchar(50)")]
        public string Name { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string Description { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string Url { get; set; }

        [Column(TypeName = "varchar(32)")]
        public string Icon { get; set; }

        [Column(TypeName = "uuid")]
        public Guid? ParentId { get; set; }

        [Required]
        [Column(TypeName = "int4")]
        public int Level { get; set; }

        [Column(TypeName = "varchar(32)")]
        public string Component { get; set; }

        [Required]
        [Column(TypeName = "int4")]
        public int Sort { get; set; }

        [Required]
        [Column(TypeName = "int4")]
        public EnumMenuStatus Status { get; set; }

        public string Code { get; set; }

        [Column(TypeName = "varchar(200)")]
        public virtual ICollection<SysMenuFunc> SysMenuFuncs { get; set; }
    }
}